<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/8/11
 * Time: 15:35
 */

namespace App\Http\Controllers\Web;


use App\Service\ConfigService;
use Illuminate\Http\Response;

class ConfigController extends BaseController
{
    public function index()
    {
        $params = $this->request->post();
        return ConfigService::getList($params);
    }

    public function getConfigById()
    {
        $id = $this->request->post('id');
        if(!$id){
            return Response()->json(['code'=>201,'msg'=>'参数缺失']);
        }
        return ConfigService::getConfigById($id);
    }

    public function edit()
    {
        $id = $this->request->post('id');
        if(!$id){
            return Response()->json(['code'=>201,'msg'=>'参数缺失']);
        }
        $params = $this->request->post();

        return ConfigService::edit($params);
    }



}
